#include<iostream>
#include<string>
#include<vector>

using namespace std;

class Solution {
public:
    bool repeatedSubstringPattern(string s) {
        int n = s.size();
        s = " " + s;
        vector<int> ne(n + 1);
        for (int i = 2, j = 0; i <= n; i++) {
            while (j && s[i] != s[j + 1])j = ne[j];
            if (s[i] == s[j + 1])j++;
            ne[i] = j;
        }
        int mod = n - ne[n];
        cout << mod << " " << n % mod;
        if (mod < n && n % mod == 0)return true;
        return false;
    }
};